<%@ page contentType="text/html; charset=UTF-8" errorPage="/WEB-INF/adm/pages/jspError.jsp"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<div>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="../private/admin_images/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="../private/admin_images/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="../private/admin_images/tb.gif" width="16" height="16" /></div></td>
                <td width="95%" align="left"><span class="font3_12px">你当前的位置</span>：[游戏奖金设置]-[游戏奖金详细信息]</td>
              </tr>
            </table></td>
            <td width="54%"><table border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td width="60"><table width="87%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center">
                      <input type="checkbox" name="checkbox62" value="checkbox" />
                    </div></td>
                    <td><div align="center">全选</div></td>
                  </tr>
                </table></td>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><img src="../private/admin_images/22.gif" width="14" height="14" /></div></td>
                    <td><div align="center">新增</div></td>
                  </tr>
                </table></td>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><img src="../private/admin_images/33.gif" width="14" height="14" /></div></td>
                    <td><div align="center">修改</div></td>
                  </tr>
                </table></td>
                <td width="52"><table width="88%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><img src="../private/admin_images/11.gif" width="14" height="14" /></div></td>
                    <td><div align="center">删除</div></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="16"><img src="../private/admin_images/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  
  <tr>
  	<td >
  	
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
  			<tr>
  				<td width="8" background="../private/admin_images/tab_12.gif">&nbsp;</td>
  				
  				<td>
  					<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  						<tr>
  							<td height="100" colspan="2"><b>游   戏  奖  金   详  细  信  息</b></td>
  						</tr>
  						<tr>
  							<td height="25" width="45%" align="right">编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</td>
  							<td align="left">&nbsp;&nbsp;<bean:write name='VIEW_HELPER' property='id'/></td>
  						</tr>
  						<tr>
  							<td height="25" align="right">会员名称：</td>
  							<td align="left">&nbsp;&nbsp;<bean:write name='VIEW_HELPER' property='userid'/></td>
  						</tr>
  						<tr>
  							<td height="25" align="right">游戏类型：</td>
  							<td align="left">&nbsp;&nbsp;<bean:write name='VIEW_HELPER' property='gametypename'/></td>
  						</tr>
  						<tr>
  							<td height="25" align="right">下注类型：</td>
  							<td align="left">&nbsp;&nbsp;<bean:write name='VIEW_HELPER' property='bettypename'/></td>
  						</tr>
  						<tr>
  							<td height="25" align="right">奖&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;金：</td>
  							<td align="left">&nbsp;&nbsp;<input type="text" id="bonus_input" name="bonus_input" size="20" style="border:1px solid #999999;"/>&nbsp;元</td>
  						</tr>
  						<tr>
  							<td height="25" align="right">最高奖金：</td>
  							<td align="left">&nbsp;&nbsp;<input type="text" id="maxBonus_input" name="maxBonus_input" size="20" style="border:1px solid #999999;"/>&nbsp;元</td>
  						</tr>
  						<tr>
  							<td height="25" align="right">返点百分比：</td>
  							<td align="left">&nbsp;&nbsp;<input type="text" id="returnPos_input" name="returnPos_input" size="20" style="border:1px solid #999999;"/>&nbsp;%&nbsp;<font color="red" >(0~100的数)</font></td>
  						</tr>
  						<tr>
  							<td height="25" align="right">初始化时间：</td>
  							<td align="left">&nbsp;&nbsp;<bean:write name='VIEW_HELPER' property='createtime'/></td>
  						</tr>
  						<tr>
  							<td height="25" align="right">更新时间：</td>
  							<td align="left">&nbsp;&nbsp;<bean:write name='VIEW_HELPER' property='updatetime'/></td>
  						</tr>
  						<tr>
  							<td height="25" align="right">初始化IP：</td>
  							<td align="left">&nbsp;&nbsp;<bean:write name='VIEW_HELPER' property='createip'/></td>
  						</tr>
  						<tr>
  							<td height="25" align="right">更新&nbsp;&nbsp;IP：</td>
  							<td align="left">&nbsp;&nbsp;<bean:write name='VIEW_HELPER' property='updateip'/></td>
  						</tr>
  						<tr>
  							<td height="30" colspan="2">&nbsp;</td>
  						</tr>
  						<tr>
  							<td height="30" colspan="2">
  								<input type="button" id="saveButton" name="saveButton" value="保存修改 " onclick="return submitUpdate();"/>
  								<input type="button" id="backButton" name="backButton" value="  返回    " onclick="return goBack();"/>
  							</td>
  						</tr>
  						
  					</table>
  				</td>
  				
  				<td width="8" background="../private/admin_images/tab_15.gif" align="right">&nbsp;</td>
  			</tr>
  		</table>
	
  	</td>
  </tr>
  
  <tr>
    <td height="35" background="../private/admin_images/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="../private/admin_images/tab_18.gif" width="12" height="35" /></td>
        <td></td>
        <td width="16"><img src="../private/admin_images/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>
<html:form action="/adm/updateBonus" method="post">
	<html:hidden property="operator" />
	<html:hidden property="currentPage" />
	<html:hidden property="userName" />
	<html:hidden property="gameType" />
	<html:hidden property="betType" />
	<html:hidden property="bonusID" />
	<html:hidden property="bonus" />
	<html:hidden property="maxBonus" />
	<html:hidden property="returnPos" />
</html:form>
<script type="text/javascript">
<!--
function isDecimal(s){
	var pattern = new RegExp(/^([0-9]+(\.?))?[0-9]+$/);
	return pattern.test(s);
}
function submitUpdate(){
	var bonus = document.getElementById("bonus_input").value;
	var maxBonus = document.getElementById("maxBonus_input").value;
	var returnPos = document.getElementById("returnPos_input").value;
	if(bonus == ""){
		alert("请输入奖金数额！");
		document.all.bonus_input.focus();
		return false;
	}
	if(!isDecimal(bonus)){
		alert("奖金数额必须为正数！");
		document.all.bonus_input.focus();
		return false;
	}
	if(maxBonus == ""){
		alert("请输入最高奖金数额！");
		document.all.maxBonus_input.focus();
		return false;
	}
	if(!isDecimal(maxBonus)){
		alert("最高奖金数额必须为正数！");
		document.all.maxBonus_input.focus();
		return false;
	}
	if(returnPos == ""){
		alert("请输入返点！");
		document.all.returnPos_input.focus();
		return false;
	}
	if(!isDecimal(returnPos) || parseFloat(returnPos) < 0 || parseFloat(returnPos) > 100){
		alert("返点必须为0~100之间正数！");
		document.all.returnPos_input.focus();
		return false;
	}
	document.all.bonus.value = bonus;
	document.all.maxBonus.value = maxBonus;
	document.all.returnPos.value = returnPos;
	document.all.operator.value = "4";
	document.all.ADMBonusForm.submit();
	return true;
}
function goBack(){
	document.all.operator.value = "2";
	var url = "listBonusTemplate.wss";
	document.all.ADMBonusForm.action = url;
	document.all.ADMBonusForm.submit();
}
document.getElementById("bonus_input").value="<bean:write name='VIEW_HELPER' property='bonus'/>";
document.getElementById("maxBonus_input").value="<bean:write name='VIEW_HELPER' property='maxbonus'/>";
document.getElementById("returnPos_input").value="<bean:write name='VIEW_HELPER' property='returnpos'/>";
//-->
</script>